package com.hairline.hairlinemarket.service;

import com.hairline.hairlinemarket.bean.MarketCart;
import com.hairline.hairlinemarket.bean.vo.CartVo;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Author:杨小凯
 * Date:2023-04-21 16:10
 * Description:<描述>
 */
@Transactional
public interface CartService {
    BigDecimal selectCountByUserId(Integer userId);

    boolean selectExist(Integer userId, Integer productId);

    boolean updateNumber(Integer userId,Integer number, Integer productId);

    MarketCart selectSpe(Integer userId, Integer productId);

    List<MarketCart> selectByUserId(Integer userId);

    Map<String, BigDecimal> selectTotal(Integer userId);

    void insertData(Integer userId, Integer goodsId, Integer number, Integer productId);

    void deleteByUPId(Integer userId, Integer productId);

    Integer selectByUPId(Integer userId, Integer productId);

    Integer updateChecked(Integer userId, Integer isChecked, ArrayList productIds);

    Map selectCartReslute(CartVo cartVo);

    List<MarketCart> selectByUPs(Integer userId, List<Integer> productIds);

    void updateNumberById(Integer id,Integer number);
}


